package com.safety51.bootstrap.demo.application.events;

import com.safety51.bootstrap.commons.event.DomainEventListener;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * Created by liuyuancheng on 2021/9/28  <br/>
 *
 * @author liuyuancheng
 */
@Component
@Slf4j
public class AsyncExampleEventListener extends DomainEventListener<AsyncExampleEvent> {
    /**
     * 重写该方法
     *
     * @param domainEvent
     */
    @Override
    @Async
    public void onApplicationEvent(AsyncExampleEvent domainEvent) {
        System.out.println(domainEvent);
        log.debug("The response for you ping is \"" + domainEvent.msg + "\"");
    }

}
